from unittest.mock import Mock

from setuptools import Extension, setup
from Cython.Build import cythonize
from distutils.command.build_ext import build_ext

mock = build_ext
mock.get_export_symbols = Mock(return_value=None)
sourcefiles = ['./MelodieAllegro/runtime.c',
               r'./MelodieAllegro/c_src/random.c',
               r'./MelodieAllegro/c_src/log.c',
               r'./MelodieAllegro/c_src/set.c',
               r'./MelodieAllegro/c_src/memory_allocation.c',
               ]

extensions = [
    Extension("MelodieAllegro.runtime", sourcefiles),
    Extension("MelodieAllegro.cython_interface.shared",
              [r'MelodieAllegro/cython_interface/shared.pyx']),
    Extension("MelodieAllegro.cppshare.random",
              [
                  r'MelodieAllegro/cppshare/random.cpp',
              ], language="c++", extra_compile_args=["-std=c++11"]),
]

setup(
    ext_modules=cythonize(extensions, gdb_debug=True),
)
